package com.qcby.dao;


import com.qcby.entity.QuestionAnswerEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface QuestionAnswerDao {
    /*
    保存聊天记录
    */
    void save(QuestionAnswerEntity questionAnswerEntity);

    /*
    查询未读消息
    */
//    有预测上线，有预测内容
    List<QuestionAnswerEntity> findUnreadMessages(String receiverSid);
    List<QuestionAnswerEntity> findreadMessages(QuestionAnswerEntity entity);
    /*
    更新消息状态为已读
    */
    void update(QuestionAnswerEntity questionAnswerEntity);

    // 新增方法，根据学生sid查询聊天记录
    List<QuestionAnswerEntity> findByStudentSid(@Param("studentSid") String studentNumber);

    Integer findStudentTeacherUnreadMessages(QuestionAnswerEntity entity);

    List<QuestionAnswerEntity> findStudentAskAi(QuestionAnswerEntity entity);
}
